package com.atguigu.gmall.juc.thread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

/**
 * @author 陈昆昆
 * @version 1.0
 * @date 2020/5/28 8:45
 */
public class TwoThread {
    public static void main(String[] args) {
        ExecutorService executorService = Executors.newFixedThreadPool(4);
        for (int i = 0; i < Integer.MAX_VALUE; i++) {
            executorService.execute(new Task());
        }
    }
}
class Task implements Runnable {

    public void run() {
//        try { TimeUnit.SECONDS.sleep(40000000); } catch (InterruptedException e) { e.printStackTrace(); }
        System.out.println(Thread.currentThread().getName()+"--->"+"执行了任务");
    }
}
